package com.cos.shop.common;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000122671111";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCYFp51dTn2DELUMJkYZ2N5nh9kGChhedwvB5e2sudvSWF0PxjJ+CGRQ0fVYme5tqvpR+HpzYWzg96J+FpLa3rQSLAoDxK6M6phUtiNK1EJdVnMJzH996RKY67PKAZJeAy0LxIlZQj832aeoUP5/PLOLbKaGDZdpYwQXYgy4DOsottpPkeLatB1fC4txOoxUv3XbYYH37OEuX8GUQTvJ24qQWVWFzusmOy4a4z3dR+InBgugNY/lntV9gGGqFPxmH3z6hdJ9ZEw7ZQklGhXAVHym6fLpmZuwbFdv/0neqPy1WR8pm6YTeNPKXadt/ZNJVDb5KX/g3EIo4X8of2273/LAgMBAAECggEACGOfA/2eX9sXSJsRps31J704IA5RE+dj5Ng3XyWJLJNQo9fjJyjfuSKL8NJHxG+2Fd0YMgxbJqbMfLHNUUGxeZG43czPDKRS7qFiPo84HhxyApfa4xZo4o2TE+wyRJUxpjK+fn+POlucTn24wS5ZulO8+VEClrHOAw0VuTCyyP/wZ4SKtQ9B/Ol1wuOmN2PzYLz+ti7aL3IEbK7tiacRRKJ4I9EeSPm2MInwkd0ZprbfQG7OWRloBRxF0nvKA1nN0lA+DHBXYs8ZwVHJLYhLPWcnwDqZqGnmWQWU5qlLWoiS5SLHCr11I1wT66MfoHETKsnyvbJt/6wclHQ3a6nsiQKBgQD20E1uZClKPHH9pQJvFItJKQiHH/cnq+eiihrPTNebvkqVP4dHGUejChndzjqivc9us8A+grZaTDGaQKUeslGjTm4WTTMtXZHAz0+qLI3G70g1Tt2vh6aGnERfp+9diQR8TAY3ecJXX4HBWI//rxFyeBz0AtdFA1Q0bSOEBFKcJQKBgQCdv8B3B9DsZfnszzFM8AM1Kd8M/FWTr7tr+s5OhSnew8trJ654SWLEh26RyUvNCjatEcyBXduWoIOKal5iRrm0nCHUUzK3ct9uvpq/xaWOJn5Z0PWersSTbW3h46oCFoqgi29pFCurmpb5xPnX6gN3kxO2097TtLafEGTHLc7xLwKBgD2FjseFkAVBK+jdyM2HgXCrGcUU4raw0vxhEG276cKYnF63hzDhzEmHqwru7Q7D4YDmrXTngCzh8TtSAda0/ESIuEg21hrox/wXsPPqRyzfWFBxaDDoz0meiiyN38yg6s1Q5fvODfNZiy52tO425VJzPkRUsPQy8DphOgkeSrlBAoGAJCTTTHKWBBQ5d3DhsucrVPsLCEaotPYG027b5lHMjiX+bcbhyt3Fq5H8W5rrq0czz+PMH7gJoDGW8hf9GDdsRV2gwq1taWsAlrdFbbsze6aGPL4MCReyIrVn/+HSCjhv+uj31fOxLdh1zzS6qiYMNVGVqsZQv+EgFsIC1UBBsjECgYBwp3p4lNI/l+f5EaH3RgvpfIyWEnq8cw6RRJHOv22UfqQnAXgtC9NL1JAQREPioiHp8kOLqYMWgG7szKXldKmAHH0PJVviBNA80HbJ2DopMb7XQQs+Hw6jBG1y/ePGhNkervdO6J2ZaGWLZoAtWuZeDvIqznnfLKX7BEjemhUlhQ==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsYD6xD20Silq6ReVJr5nNGy+6JFG7GQQoRY++XjCBiqgq/WVl8KX7NlP3hm+Vp+OKGg3r2ZU0ii+FDVFd2Sl0CihG5GG9kQvwWy9ngxECmHu7eiHF1O5N7ddCKDLHzqK61VwmuMu+HKF4e+GVRJRG7pHoaQYZpP5oaWXm/abc0wvas54bNpC0ij7V78/GgLdJ1vHoK+8MVhyGHr83JjTqDMqqdkM4o3pacLCc+sbbeIftKiNNz3Q8aYLlLecAkyMvAvur4gGRuU+mXp8M0AeaF9pXaa3/Pnw5Z30Q4JAnpJdKhmbCyWfXvQ8VWyQ7oyHBZeDvTjJHeEp/sT09Mpn+wIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://vyip7t.natappfree.cc/notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://vyip7t.natappfree.cc/getReturn";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\Users\\cos\\Desktop\\alipay.trade.page.pay-JAVA-UTF-8\\src\\a.log";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

